package 数组;

public class Test1 {
    public static void main(String[] args) {
        test1();
    }
    public static void test1()
    {
        String pokers[] = new String[54];
        String colors[] = {"♠","♥","♣","♦"};
        String numbers[] = {"A","2","3","4","5","6","7","8","9","10","J","Q","K"};
        int i = 0;
        int j = 0;
        int index = 0;
        for(i = 0;i<numbers.length;i++)
        {
            for(j = 0;j<colors.length;j++)
            {
                pokers[index] = colors[j]+numbers[i];
                index++;
            }
        }
        pokers[index++] ="大王";
        pokers[index] ="小王";
        System.out.println("新牌：");
        for(i = 0;i<pokers.length;i++)
        {
            System.out.print(pokers[i]+"\t");
        }
        System.out.print("\n");

        System.out.println("洗牌后：");
        for(i = 0;i < pokers.length;i++)
        {
            int index1 = (int)(Math.random()*pokers.length);
            int index2 = (int)(Math.random()*pokers.length);
            String tmp = pokers[index1];
            pokers[index1] = pokers[index2];
            pokers[index2] = tmp;

        }
        for(i = 0;i<pokers.length;i++)
        {
            System.out.print(pokers[i]+'\t');
        }
    }
}
